package com.ctshk.rpc.order.season.service;

import com.ctshk.common.dto.Result;
import com.ctshk.common.dto.payment.CallPayDTO;
import com.ctshk.common.model.AppReq;
import com.ctshk.common.model.TokenUser;
import com.ctshk.common.req.pay.NotifyConsumeReq;
import com.ctshk.rpc.order.season.dto.MySeasonOrderDTO;
import com.ctshk.rpc.order.season.dto.SeasonOrderDTO;
import com.ctshk.rpc.order.season.dto.SeasonProductReplenishDTO;
import com.ctshk.rpc.order.season.dto.SeasonSearchOrderDTO;
import com.ctshk.rpc.order.season.req.*;
import springfox.documentation.annotations.ApiIgnore;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 套票订单 服务类
 * </p>
 *
 * @author 杨林
 * @since 2021-03-24
 */
public interface ISeasonOrderService {
    Result callPay(SeasonPortExpressOrderAppCallPayReq callPayReq);

    Result payment(NotifyConsumeReq notifyConsumeReq);

    //C端发起支付接口
    //发起支付
    CallPayDTO getCallPayInfo(Long id);

    //H5/PC的下单接口
    Result saveSeasonOrder(SeasonOrderReq req, Long userId, Integer channelType, AppReq appReq);

    //TOB的下单接口
    Result saveSeasonOrderTob(SeasonOrderReq req, Long userId, Integer channelType);


    /* @MethodName: 核对订单
     * @Description: TODO
     * @Param:
     * @Return:
     * @Author: 杨林
     * @Date:2021/3/25 14:55
     **/
    Result checkSeasonOrder(SeasonOrderReq req, TokenUser user);

    /* @MethodName: 保存订单信息
     * @Description: TODO
     * @Param:
     * @Return:
     * @Author: 杨林
     * @Date:2021/3/25 17:41
     **/
    Result saveOrderPay(List<SeasonOrderPayReq> reqList, Long userId);


    /* @MethodName: 订单中心  套票订单
     * @Description: TODO
     * @Param:
     * @Return:
     * @Author: 杨林
     * @Date:2021/3/29 11:27
     **/
    Result searchSeasonOrder(SearchSeasonOrderReq req, TokenUser user);

    /* @MethodName: 获取订单详情
     * @Description: TODO
     * @Param:
     * @Return:
     * @Author: 杨林
     * @Date:2021/3/29 16:47
     **/
    SeasonSearchOrderDTO getOrderInfoById(Long id);

    /* @MethodName: 获取订单须知信息
     * @Description: TODO
     * @Param:
     * @Return:
     * @Author: 杨林
     * @Date:2021/3/29 18:30
     **/
    SeasonProductReplenishDTO getProductReplenishInfo(Long productId);


    /* @MethodName: 取消订单
     * @Description: TODO
     * @Param:
     * @Return:
     * @Author: 杨林
     * @Date:2021/3/30 9:07
     **/
    Result cancelOrder(SeasonOrderCancelReq req, TokenUser currentUser);

    /* @MethodName: 取消订单  退款
     * @Description: TODO
     * @Param:
     * @Return:
     * @Author: 杨林
     * @Date:2021/3/30 10:51
     **/
    Result refundOrder(SeasonOrderRefundReq req, TokenUser currentUser);

    /* @MethodName: 退款审核
     * @Description: TODO
     * @Param:
     * @Return:
     * @Author: 杨林
     * @Date:2021/3/30 11:50
     **/
    Result refundAuditResult(RefundAuditReq req, TokenUser user);

    /* @MethodName: 通知旅客
     * @Description: TODO
     * @Param:
     * @Return:
     * @Author: 杨林
     * @Date:2021/4/8 10:53
     **/
    Result notice(SeasonOrderNoticeReq seasonOrderNoticeReq);

    /* @MethodName: 动态套票 各个单项 供应商确认
     * @Description: TODO
     * @Param:
     * @Return:
     * @Author: 杨林
     * @Date:2021/4/14 10:22
     **/
    Result affirmDynamicOrder(DynamicAffirmOrderReq req);


    /* @MethodName: 动态套票 各个单项 取消订单 退款状态
     * @Description: TODO
     * @Param:
     * @Return:
     * @Author: 杨林
     * @Date:2021/4/20 10:13
     **/
    Result cancelOrderStatus(CancelStatusReq req);

    /**
     * 最近一次查询结束时间到当前时间的数据
     *
     * @return
     */
    Result<List<MySeasonOrderDTO>> recentToNow(LocalDateTime recent, LocalDateTime now);

    BigDecimal getPackageProduct(SeasonOrderReq req, Integer channelType, Long relId);

    BigDecimal getPackageProduct(AppCalculatePriceReq req, Integer channelType, Long relId);

    /**
     * 最近一次查询结束时间到当前时间的订单DTO
     */
    List<SeasonOrderDTO> queryOrderDTOList(LocalDateTime recent, LocalDateTime now);
}
